<!-- 购物卡结佣管理-购物卡库存-出入库记录-->
<template>
    <div class="shoppingCardStockRecord">
        <div class="mb20">
            <span><b>id:</b>{{info.id}}</span>
            <span class="ml50 mr50"><b>所属楼盘:</b> {{info.devName}}</span>
            <span><b>采购方:</b>{{info.purchaserName}}</span>
        </div>

        <el-table :data="info.list" border style="width: 100%">
            <el-table-column align="center" type="index" label="序号" width="50"></el-table-column>
            <el-table-column align="center" prop="inOutFlag" label="出入库">
                <template slot-scope="scope">{{["入库","出库"][scope.row.inOutFlag - 1]}}</template>
            </el-table-column>
            <el-table-column align="center" prop="typeName" label="类别"></el-table-column>
            <el-table-column align="center" prop="cardCode" label="卡号"></el-table-column>
            <el-table-column align="center" prop="cardDenomination" label="面额">
                <template slot-scope="scope">{{scope.row.cardDenomination | formatMoney}}</template>
            </el-table-column>
            <el-table-column align="center" prop="cardMedia" label="电子卡/实体卡">
                <template slot-scope="scope">{{["电子卡","实体卡"][scope.row.cardMedia - 1]}}</template>
            </el-table-column>
            <el-table-column align="center" label="数量">
                <template slot-scope="scope">{{scope.row.inOutFlag === 1 ? "+1" : "-1"}}</template>
            </el-table-column>
            <el-table-column align="center" label="剩余数量">
                <template slot-scope="scope">{{scope.row.inOutFlag === 1 ? "1" : "0"}}</template>
            </el-table-column>
            <el-table-column align="center" prop="inOutDetail" label="出入库类型"></el-table-column>
            <el-table-column align="center" prop="creatorName" label="操作人"></el-table-column>
            <el-table-column align="center" prop="createTime" label="操作时间"></el-table-column>
        </el-table>
    </div>
</template>

<script type="text/ecmascript-6">
    import api from '@/api/apiPath';
    import utils from "@/common/utils.js";

    export default {
        name: 'shoppingCardStockRecord',
        data() {
            return {
                id: "",
                info: {
                    list: []
                }
            }
        },
        created() {
            this.id = this.$route.query.id;
            this.getRecord()
        },
        mounted() {

        },
        methods: {
            getRecord() {
                this.axios.post(api.couponShoppingCardInOutStoreRecord, {
                    id: this.id
                }).then((res) => {
                    this.info = res.data.data
                })
            }
        },
        filters: {
            formatMoney(money) {
                return utils.formatMoney(money)
            }
        }
    }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="stylus">

</style>
